import cookies from 'js-cookie'

const tokenKey = 'hrsaas-token'
const tokenTimeKey = 'hrsaas-token-time'
const getToken = function () {
  return cookies.get(tokenKey)
}

const setToken = token => {
  return cookies.set(tokenKey, token)
}

const removeToken = function () {
  return cookies.remove(tokenKey)
}

const getTokenTime = function () {
  return cookies.get(tokenTimeKey)
}

const setTokenTime = function () {
  return cookies.set(tokenTimeKey, Date.now())
}

const removeTokenTime = function () {
  return cookies.remove(tokenTimeKey)
}

export {
  getToken,
  setToken,
  removeToken,
  getTokenTime,
  setTokenTime,
  removeTokenTime
}
// import Cookies from 'js-cookie'

// const TokenKey = 'vue_admin_template_token'

// export function getToken() {
//   return Cookies.get(TokenKey)
// }

// export function setToken(token) {
//   return Cookies.set(TokenKey, token)
// }

// export function removeToken() {
//   return Cookies.remove(TokenKey)
// }
